import 'package:bxultimate/app/router/router_name.dart';
import 'package:bxultimate/app/theme/app_theme.dart';
import 'package:bxultimate/app/theme/gaps.dart';
import 'package:bxultimate/data/store/auth_store.dart';
import 'package:bxultimate/widgets/mk_card_container.dart';
import 'package:bxultimate/widgets/mk_list_cell_item.dart';
import 'package:bxultimate/widgets/mk_page.dart';
import 'package:bxultimate/widgets/mk_scroll_view.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import 'controller.dart';

class UserAccountCancelPage extends StatefulWidget {
  const UserAccountCancelPage({Key? key}) : super(key: key);

  @override
  State<UserAccountCancelPage> createState() => _UserAccountCancelPageState();
}

class _UserAccountCancelPageState extends State<UserAccountCancelPage> {
  final controller = Get.find<UserAccountCancelController>();
  final state = Get.find<UserAccountCancelController>().state;

  @override
  Widget build(BuildContext context) {
    return MkPage(
        child: Scaffold(
            backgroundColor: Colors.transparent,
            appBar: TDNavBar(
              title: '',
              backgroundColor: Colors.transparent,
            ),
            body: MkScrollView(
              bottomButton: TDButton(
                onTap: () {
                  controller.accountCancel();
                },
                text: '确认注销',
                isBlock: true,
                theme: TDButtonTheme.primary,
              ),
              children: [
                Padding(
                  padding: EdgeInsets.all(AppTheme.iDefaultPadding),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: <Widget>[
                      Center(
                        child: Column(
                          children: [
                            Icon(Icons.delete,size: 24,), Text('注销账号',style: TextStyle(fontSize: 16))
                          ],
                        ),
                      ),
                      Gaps.vGap32,
                      Text('您的账号注销后，在本系统内的所有数据将被清空，且不可恢复。请谨慎操作！！！',style: TextStyle(fontSize: 16,color: Colors.redAccent,fontWeight: FontWeight.bold),),

                    ],
                  ),
                )
              ],
            )
        ));
  }

  @override
  void dispose() {
    Get.delete<UserAccountCancelController>();
    super.dispose();
  }
}
